package YanShen;

import java.util.Objects;

public class Role {
    private String name;
    private String attribute;

    private String rarity;

    private int constellation;
    private int grade;
    private String characteristic;

    public Role(String name, String attribute, String rarity, int constellation, int grade, String characteristic) {
        this.name = name;
        this.attribute = attribute;
        this.rarity = rarity;
        this.constellation = constellation;
        this.grade = grade;
        this.characteristic = characteristic;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAttribute() {
        return attribute;
    }

    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    public String getRarity() {
        return rarity;
    }

    public void setRarity(String rarity) {
        this.rarity = rarity;
    }

    public int getConstellation() {
        return constellation;
    }

    public void setConstellation(int constellation) {
        this.constellation = constellation;
    }

    public int getGrade() {
        return grade;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }

    public String getCharacteristic() {
        return characteristic;
    }

    public void setCharacteristic(String characteristic) {
        this.characteristic = characteristic;
    }

    @Override
    public String toString() {
        return "角色列表{" +
                "名字：'" + name + '\'' +
                ", 属性：'" + attribute + '\'' +
                ", 稀有度：'" + rarity + '\'' +
                ", 命座：" + constellation +
                ", 等级：Lv.'" + grade +  '\'' +
                ", 特点：'" + characteristic + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Role role = (Role) o;
        return constellation == role.constellation && grade == role.grade && Objects.equals(name, role.name) && Objects.equals(attribute, role.attribute) && Objects.equals(rarity, role.rarity) && Objects.equals(characteristic, role.characteristic);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, attribute, rarity, constellation, grade, characteristic);
    }
}
